package edu.pku.sei.transformation.editor.controller.policies;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.CreateRequest;

import edu.pku.sei.modeler.model.structure.MetaNode;
import edu.pku.sei.transformation.editor.controller.commands.CommandFactory;

public class RuleFlowLayoutPolicy extends NestedNodeFlowLayoutPolicy {

	@Override
	protected Command getCreateCommand(CreateRequest request) {
		// Rectangle constraint = new Rectangle();
		MetaNode objectNode = (MetaNode) getHost().getModel();
		MetaNode variableNode = (MetaNode) request.getNewObject();

		Command cmd =  CommandFactory
				.getCreateCommand(variableNode, objectNode,
						getFeedbackIndexFor(request));
		return cmd;
	}

}
